var getRow = function (rowIndex) {
    const ret = []
    for (let i = 0; i < rowIndex; i++) {
        const row = new Array(i + 1).fill(1);
        for (let j = 1; j < row.length - 1; j++) {
            row[j] = ret[i - 1][j - 1] + ret[i - 1][j];
        }
        ret.push(row);
        // console.log(ret);
    }
    // console.log(ret[]);

    return ret[3];
}
let arr = getRow(3);
console.log(arr);


